package com.taoyibao.hongcanting.model;

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;

/**
 * @author TangAnna
 * @description: 地图礼物中子类
 * @date :${DATA} 19:34
 */
@SuppressLint("ParcelCreator")
public class GiftInfoModel implements Parcelable {
    /**
     * id : 2
     * gift_name : 飞天火箭
     * gift_type : 1
     * img_url :
     * price : 199
     * status : 1
     * create_at : 1546590015
     * update_at : 1546590625
     * sort : 44
     */

    public String id;
    public String gift_name;
    public int gift_type;
    public String img_url;
    public double price;
    public int status;
    public int create_at;
    public int update_at;
    public int sort;
    public boolean isCheckd;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {

    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GiftInfoModel that = (GiftInfoModel) o;
        return gift_type == that.gift_type &&
                Double.compare(that.price, price) == 0 &&
                status == that.status &&
                create_at == that.create_at &&
                update_at == that.update_at &&
                sort == that.sort &&
                isCheckd == that.isCheckd &&
                Objects.equals(id, that.id) &&
                Objects.equals(gift_name, that.gift_name) &&
                Objects.equals(img_url, that.img_url);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, gift_name, gift_type, img_url, price, status, create_at, update_at, sort, isCheckd);
    }
}
